<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>运营平台</title>

  
	 <import type="css" basepath="__CSS__" file="bootstrap" />
	 	<import type="css" basepath="__CSS__" file="style" />
	
	
</head>

<body>
<div class="topNav">
    <span class="text"><i class="iconfont">&#xe607;</i><a href="{:U('Index/index')}" target="_top" >首页</a>&gt;<span>系统管理</span>&gt;<span>管理员账号</span>&gt;<span>新增管理员</span></span>
</div>

<div class="contain">
    <div class="pageTitle">
        <h2 class="title">新增管理员</h2>
    </div>

    <div class="formBoxOne">
        <form>
      
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">管理员等级</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
				    
					<select  id="level" class="inpTextOne form-control">
                       <foreach name="typeArr" item="val">
					   <option value="{$key}">{$val}</option>
					   </foreach>
                    </select>
						
                    </div>
                </div>
            </div>
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">管理员账号</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <input type="text" id="username" class="inpTextOne form-control">
                    </div>
                </div>
            </div>
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">管理员密码</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <input type="password" id="password" class="inpTextOne form-control">
                    </div>
                </div>
            </div>
			
			
			 <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">确认密码</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <input type="password" id="passtwice" class="inpTextOne form-control">
                    </div>
                </div>
            </div>
			
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">管理员姓名</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <input type="text" id="fullname" class="inpTextOne form-control">
                    </div>
                </div>
            </div>
			
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <span class="name w100">管理员电话</span>
                    <div class="col-md-8 col-sm-8 col-xs-8">
                        <input type="text" id="phone" class="inpTextOne form-control">
                    </div>
                </div>
            </div>
			
			
            <div class="line">
                <div class="col-md-6 col-sm-6 col-xs-6">
                    <div class="marl100 col-md-8">
                        <button  class="btn btn-primary" data-text="保存成功！">保存</button>
                        <a href="{:U('Rule/index')}"><button type="button" class="btn btn-info">返回</button></a>
                    </div>
                </div>
            </div>
        </form>
    </div>
</div>

<!--提示模态框 begin-->
<div class="modal fade" id="popupPrompt">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">提示</h4>
            </div>
            <div class="modal-body">
                <p class="text"></p>
            </div>
            <div class="modal-footer">
                <a href="{:U('Rule/index')}"><button type="button" class="btn btn-primary" data-dismiss="modal">确定</button></a>
            </div>
        </div>
    </div>
</div>
<!--提示模态框 end-->
<script src="/App/Admin/public/js/jquery-2.1.1.min.js"></script>
<script src="/App/Admin/public/js/bootstrap.min.js"></script>
<script src="/App/Admin/public/js/form.js"></script>

<script type="text/javascript">
	$('.btn-primary').on('click',function(){
	
	var username = $('#username').val();
	var  level = $('#level').val();
    var phone = $('#phone').val();
    var password = $('#password').val();
	var passtwice = $('#passtwice').val();
	var fullname = $('#fullname').val();
	
	
	 if( username == ''){
	    alert("账号不能为空");
		return false;
	    }
     if( password == ''){
	   alert("密码不能为空");
	   return false;
	    }
	
	 if( passtwice == ''){
	   alert("确认密码不能为空");
	   return false;
	    }


	
	if( password != passtwice){
      alert('确认密码与首次密码输入不符');
	  return false;
   }
	
	
	 if( fullname == ''){
	   alert("姓名不能为空");
	   return false;
	    }


     if( phone == ''){
	   alert("电话不能为空");
	   return false;
	    }

	
	
     $.post('{:U("Rule/save")}',{username:username,phone:phone,password:password,fullname:fullname,level:level},function(data){
		  if(data.status==100){
		 	//	alert('修改成功');
				window.location='{:U("Rule/index")}';
			   }else{
			/*	alert(data.info);*/
		    	window.location='{:U("Rule/index")}';
				 }
		 })
	
	
});
	</script>



</body>
</html>